package com.example.demo.security.service.Impl;

import com.example.demo.common.MyBatisUtils;
import com.example.demo.security.dao.AdminGroupRoleDao;
import com.example.demo.security.model.AdminGroupRole;
import com.example.demo.security.service.AdminGroupRoleService;
import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminGroupRoleServiceImpl implements AdminGroupRoleService {
    @Override
    public List<AdminGroupRole> selectAdminGroupRole(int GroupId) {
        SqlSession sqlSession = MyBatisUtils.getSqlSession();
        AdminGroupRoleDao adminGroupRoleDao =  sqlSession.getMapper(AdminGroupRoleDao.class);
        List<AdminGroupRole> adminGroupRole = adminGroupRoleDao.selectByGroupRole(GroupId);
        sqlSession.close();
        return adminGroupRole;
    }
}
